### Do not edit -- Generated by 'configure --with-whatever' from Makefile.in
### RtAudio library Makefile

RM = /bin/rm
LN = /bin/ln

OBJECTS	= RtAudio.o @objects@

LIBNAME = librtaudio
STATIC = $(LIBNAME).a
SHARED = @sharedlib@
RELEASE = 4.1.1
MAJOR = 4
LIBRARIES = $(STATIC) $(SHARED)

CC       = @CXX@
AR       = @AR@
RANLIB   = @RANLIB@

DEFS     = @CPPFLAGS@
CFLAGS   = @CXXFLAGS@ -Iinclude -fPIC

PREFIX   = @prefix@

all : $(LIBRARIES)

tests:
	cd tests && $(MAKE) all

$(LIBRARIES): $(OBJECTS)
	$(AR) ruv $(STATIC) $(OBJECTS)
	ranlib $(STATIC)
	$(CC) -fPIC @libflags@ $(OBJECTS) @LIBS@
	$(LN) -sf @sharedname@ $(SHARED)
	$(LN) -sf @sharedname@ $(SHARED).$(MAJOR)

%.o : %.cpp
	$(CC) $(CFLAGS) $(DEFS) -c $(<) -o $@

%.o : include/%.cpp
	$(CC) $(CFLAGS) $(DEFS) -c $(<) -o $@

install:
	install --mode=755 $(STATIC) $(PREFIX)/lib/
	install --mode=755 @sharedname@ $(PREFIX)/lib/
	$(LN) -sf @sharedname@ $(PREFIX)/lib/$(SHARED)
	$(LN) -sf @sharedname@ $(PREFIX)/lib/$(SHARED).$(MAJOR)
	install --mode=644 $(LIBNAME).pc $(PREFIX)/lib/pkgconfig
	install --mode=644 RtAudio.h $(PREFIX)/include/
	install --mode=755 rtaudio-config $(PREFIX)/bin/

uninstall:
	-@rm -vf $(patsubst %,$(PREFIX)/lib/%, $(LIBRARIES) $(SHARED).$(MAJOR) $(SHARED).$(RELEASE))
	-@rm -vf $(PREFIX)/lib/pkgconfig/$(LIBNAME).pc
	-@rm -vf $(PREFIX)/bin/rtaudio-config

clean : 
	$(RM) -f $(LIBRARIES) @sharedname@ $(SHARED)*
	$(RM) -f $(OBJECTS)
	$(RM) -f *~
	cd tests && $(MAKE) clean

distclean:
	$(RM) -f $(LIBRARIES) @sharedname@ $(SHARED)*
	$(RM) -f $(OBJECTS)
	$(RM) -f *~
	$(RM) -rf config.log config.status autom4te.cache Makefile rtaudio-config $(LIBNAME).pc
	cd tests && $(MAKE) distclean

strip : 
	strip $(LIBRARIES)
	ranlib $(LIBRARIES)
	cd tests && $(MAKE) strip

.PHONY: clean distclean strip install uninstall
